﻿@using MvcPaging
@model MvcPaging.IPagedList<TuanAnhPersonalWeb.Models.EmployeeModel>



<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
           Tên Nhân Viên
        </th>
       
        <th>
            Phòng Ban
        </th>
        <th>
            Hình Ảnh
        </th>
        <th>
            Chức Vụ
        </th>
        <th></th>
    </tr>
     @if (Model.Count > 0)
     { 
foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.EMP_NAME)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.POS_NAME)
        </td>
      
             
        <td>
           <img src=@item.EMP_IMAGE width="100px" height="100px"/>
        </td>
        
        <td>
            @Html.DisplayFor(modelItem => item.EMP_TITLE)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.EMP_ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.EMP_ID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.EMP_ID })
        </td>
    </tr>
}
     }
     else
     {
         <tr>
            <td colspan="5" align="center">No data to display</td>
        </tr> 
     }
         


</table>
<div class="pager">
  @Ajax.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Employee", action = "Search", keySearch = ViewData["keySearch"], valSearch = ViewData["valSearch"], POS_ID = ViewData["Positions"] }, new AjaxOptions { UpdateTargetId = "divGrid", OnBegin = "beginPaging", OnSuccess = "successPaging" })
 </div>